import React, { Component } from 'react'
import './index.scss'
export default class MapHome extends Component {
    componentDidMount() {
        console.log(window.BMapGL);
        var map = new window.BMapGL.Map("container");
        var point = new window.BMapGL.Point(116.331398, 39.897445);
        map.centerAndZoom(point, 15);

        function myFun(result) {
            map.setCenter(result.name);
            alert("当前定位城市:" + result.name);
        }
        var myCity = new window.BMapGL.LocalCity();
        myCity.get(myFun);
    }
    render() {
        return (
            <div id="container"></div>
        )
    }
}
